﻿using B.S.BaseData.Domain.Status;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.S.BaseData.Domain.RBAC
{
	/// <summary>
	/// 用户信息
	/// </summary>
	[Table("UserInfo")]
	public class UserInfo:BaseData
	{
        /// <summary>
        /// 用户ID
        /// </summary>
        [Key]
        public int UserId { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        public string NickName { get; set; }
        /// <summary>
        /// 手机
        /// </summary>
        public string Phone { get; set; }
        /// <summary>
        /// 所属部门
        /// </summary>
        public int DepartmentId { get; set; }
        /// <summary>
        /// 会员等级
        /// </summary>
        public int VipLevel { get; set; }
        /// <summary>
        /// 订单数
        /// </summary>
        public int OrderCount { get; set; }
        /// <summary>
        /// 金额
        /// </summary>
        public decimal Money { get; set; }
        /// <summary>
        /// 积分
        /// </summary>
        public int Points { get; set; }

		/// <summary>
		/// 用户状态
		/// </summary>
		public UserStatusEnum UserStatus { get; set; }
        /// <summary>
        /// 用户状态名称
        /// </summary>
        public string UserStatusName
        {
            get
            {
                if (UserStatus == UserStatusEnum.正常) { return "正常";}
                else if (UserStatus == UserStatusEnum.异常) { return "异常"; }
                else if (UserStatus == UserStatusEnum.冻结) { return "冻结"; }
                else { return "删除";}
            }
        }
    }
}
